﻿using System;
using System.Linq;
using System.Windows;

namespace Memory_Board
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        public int totalPlayer;

        public Window1()
        {
            InitializeComponent();
        }

        public void Checked(object sender, RoutedEventArgs e)
        {
            if (sender == radioButton1)
            {
                totalPlayer = 1;
            }
            else if (sender == radioButton2)
            {
                totalPlayer = 2;
            }
            else if (sender == radioButton3)
            {
                totalPlayer = 3;
            }
            else if (sender == radioButton4)
            {
                totalPlayer = 4;
            }
            else
            {
                totalPlayer = 0;
            }
        }
        public void Start_Click(object sender, RoutedEventArgs e)
        {
            if (totalPlayer == 1)
            {
                MessageBox.Show("There will be one Player playing!");
                this.Hide();
            }
            else if (totalPlayer == 2)
            {
                MessageBox.Show("There will be two Players playing!");
                this.Hide();
            }
            else if (totalPlayer == 3)
            {
                MessageBox.Show("There will be three Players playing!");
                this.Hide();
            }
            else if (totalPlayer == 4)
            {
                MessageBox.Show("There will be four Players playing!");
                this.Hide();
            }
            else
            {
                MessageBox.Show("Please select the number of players.");
            }
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            totalPlayer = 1;
            this.Hide();
            e.Cancel = true;
            MessageBox.Show("There will be one Player playing!");
        }
    }
}
        
    

